import api from '../index.js' 
 //调用领导查看商品小类视图接口
export const wyy = (params) => {
	const url = `/vapi/LeaderV/LeaderView?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	 return api.post(url, params)
}

//查询三级分类商品销售列表
export const goodsClassList = () => {
	const url = `/vapi/LeaderV/getGoodsList`
	 return api.get(url)
}

// 导出领导查看商品小类视图列表
export const getClassListExport = (params) => {
	let url = '/vapi/LeaderV/LeaderViewOut'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}

//查询商品大类供应商商品销售情况列表
export const  LeaderTopClass= (params) => {
	const url = `/vapi/LeaderV/LeaderTopClass`
	 return api.post(url, params)
}

// 导出商品大类供应商商品销售情况列表
export const getLeaderTopClassExport = (params) => {
	let url = '/vapi/LeaderV/LeaderTopClassOut'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}

//订单统计详情
export const orderCount = (params) => {
	const url = `/vapi/LeaderV/OrderDetailList?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	 return api.post(url, params)
}

//子订单数目统计
export const orderDetailNum = (params) => {
	const url = `/vapi/LeaderV/OrderMany`
	 return api.post(url, params)
}

//总订单数目统计
export const orderNum = (params) => {
	const url = `/vapi/LeaderV/CountOrderNoNum`
	 return api.post(url, params)
}

//上下架历史查询
export const getRackhistory = (params) => {
	const url = `/vapi/chart/LeaderV/getGoodsrackhistory?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	 return api.post(url, params)
}

//业务线商品查询hzr
export const businessorderCount = (params) => {
	const url = `/vapi/chart/LeaderV/getBusinessline?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	 return api.post(url, params)
}

//子订单数目统计
export const orderDetailNumhzr = (params) => {
	const url = `/vapi/LeaderV/OrderManyhzr`
	 return api.post(url, params)
}

//总订单数目统计
export const orderNumhzr = (params) => {
	const url = `/vapi/LeaderV/CountOrderNoNumhzr`
	 return api.post(url, params)
}


// 导出订单统计列表
export const getExport = (params) => {
	let url = '/vapi/LeaderV/OrderDetailListOut'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}

//供应商列表
export const supplierList = () => {
	const url = `/vapi/supplier-activity/supplier/list`
	 return api.get(url)
}

//采购单位列表
export const getUnitNameList = () => {
	const url = `/vapi/LeaderV/getUnitNameList`
	 return api.get(url)
}

//管理仓折线图，2022年份输出销售额
export const getGuanLiCangYear = () => {
	const url = `/vapi/LeaderV/getGuanLiCangYear`
	 return api.get(url)
}

//管理仓折线图，2023年份输出销售额
export const getGuanLiCangYearNew = () => {
	const url = `/vapi/LeaderV/getGuanLiCangYearNew`
	 return api.get(url)
}

//管理仓折线图，2022月度输出销售额
export const getGuanLiCangMonth = () => {
	const url = `/vapi/LeaderV/getGuanLiCangMonth`
	 return api.get(url)
}

//管理仓统计本月交易总额
export const guanLiCangCount = () => {
	const url = `/vapi/LeaderV/guanLiCangCount`
	 return api.get(url)
}

//管理仓本月预计可对账金额(向前推40天数据)
export const benYueYuJiDuiZhang = () => {
	const url = `/vapi/LeaderV/benYueYuJiDuiZhang`
	 return api.get(url)
}

//今日订单金额(不包括预占订单)
export const jinRDingDanJinE = () => {
	const url = `/vapi/LeaderV/jinRDingDanJinE`
	 return api.get(url)
}

//本周收入金额
export const benZhouShouRJinE = () => {
	const url = `/vapi/LeaderV/benZhouShouRJinE`
	 return api.get(url)
}

//本月收入金额
export const benYueShouRJinE = () => {
	const url = `/vapi/LeaderV/benYueShouRJinE`
	 return api.get(url)
}

//上月收入金额
export const shangYueShouRJinE = () => {
	const url = `/vapi/LeaderV/shangYueShouRJinE`
	 return api.get(url)
}

//本年销售金额
export const benNianXiaoShouShouR = () => {
	const url = `/vapi/LeaderV/benNianXiaoShouShouR`
	 return api.get(url)
}

//上月订单金额
export const shangYueDingDanJinE = () => {
	const url = `/vapi/LeaderV/shangYueDingDanJinE`
	 return api.get(url)
}

//本年全部下单金额
export const yearBuyCount = () => {
	const url = `/vapi/LeaderV/yearBuyCount`
	 return api.get(url)
}

//年度累计可对账金额
export const canReconciliationCount = () => {
	const url = `/vapi/LeaderV/canReconciliationCount`
	 return api.get(url)
}

//本月全部下单金额
export const yueBuyCount = () => {
	const url = `/vapi/LeaderV/yueBuyCount`
	 return api.get(url)
}

//智能柜统计输出子订单数量和总金额
export const getGuanLiCangMonthNew = () => {
	const url = `/vapi/LeaderV/getGuanLiCangMonthNew`
	 return api.get(url)
}

//智能柜报表数据
export const getSmartCabinetsList = (params) => {
	const url = `/vapi/LeaderV/getSmartCabinetsList`
	 return api.post(url,params)
}

//导出智能柜报表数据
export const smartCabinetsListOut = (params) => {
	let url = '/vapi/LeaderV/smartCabinetsListOut'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}

//智能柜子订单数目统计
export const SmartCabinetsCount = (params) => {
	const url = `/vapi/LeaderV/SmartCabinetsCount`
	 return api.post(url, params)
}

//智能柜总订单数目统计
export const SmartCabinetsCount1 = (params) => {
	const url = `/vapi/LeaderV/SmartCabinetsCount1`
	 return api.post(url, params)
}

//采购组织订单金额统计
export const getpurchaseBuyCount = (params) => {
	const url = `/vapi/LeaderV/getpurchaseBuyCount?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	 return api.post(url, params)
}

//导出采购组织订单金额统计
export const getpurchaseBuyCountOut = (params) => {
	let url = '/vapi/LeaderV/getpurchaseBuyCountOut'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}

//本年销售金额
export const getYearBuy = (params) => {
	const url = `/vapi/LeaderV/getYearBuy`
	 return api.post(url,params)
}

//本年商品类别销售情况
export const getGoodsSourceCount1 = () => {
	const url = `/vapi/chart/LeaderV/getGoodsSourceCount1`
	 return api.get(url)
}

//采购组织订单金额总览
export const getPurchaseBuyCountEsay = () => {
	const url = `/vapi/LeaderV/getPurchaseBuyCountEsay`
	 return api.get(url)
}

//所有组织总金额
export const getPurchaseBuyCountEsayAll = () => {
	const url = `/vapi/LeaderV/getPurchaseBuyCountEsayAll`
	 return api.get(url)
}

//pscs下单情况
export const getPscsBuyCount = () => {
	const url = `/vapi/LeaderV/getPscsBuyCount`
	 return api.get(url)
}

//最近30天下单情况（管理仓）
export const zuiJinMonthCount = () => {
	const url = `/vapi/LeaderV/ZuiJinMonthCount`
	 return api.get(url)
}


//通过sku查询订单
export const selGoodItemBySKU = (params) => {
	const url = `/vapi/shoporder/selGoodItemBySKU?pageNum=${params.pageNum}&pageSize=${params.pageSize}`
	 return api.post(url, params)
}

//导出通过sku查询订单
export const selGoodItemBySKUExport = (params) => {
	let url = '/vapi/shoporder/selGoodItemBySKUExport'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}

// 导出四条业务线在架情况
export const Exportgoodsrack = (params) => {
	let url = '/vapi/chart/LeaderV/Exportgoodsrack'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}

// 导出四条业务线订单情况hzr
export const ExportBusinesslineOrder = (params) => {
	let url = '/vapi/chart/LeaderV/ExportBusinesslineOrder'
	if (params) {
		url = url + '?'
		for (const key in params) {
			url = url + key + '=' + params[key] + '&'
		}
		url = url.substring(0, url.length - 1)
	}
	return api.postDownload(url, params)
}


//查询采购员计划列表
export const selPSCSHTJH = (params) => {
	const url = `/vapi/wbservice/apiOrder/selPSCS_HTJH`
	 return api.post(url, params)
}

//物料号查询商品列表
export const searchByIdMatlList = (params) => {
	const url = `/vapi/item/searchByIdMatlList`
	 return api.post(url, params)
}


